<template>
    <div id="aboutus">
        <div class="left">
            <aboutleft :sortId.sync="sortId"></aboutleft>
        </div>
        <div class="right">
            <aboutright :newsList="list"></aboutright>
        </div>
    </div>
</template>
<script>
import aboutLeft from '@/views/AboutLeft';
import aboutRight from '@/views/AboutRight';
export default {
    data() {
        return {
            sortId: 1,
            list: [],
        };
    },
    watch: {
        sortId: {
            handler(val) {
                if (val == 1) {
                    this.list = [
                        { id: 1, title: '行业资讯1', time: '2021-05-18' },
                        { id: 2, title: '行业资讯2', time: '2021-05-18' },
                    ];
                } else if (val == 2) {
                    this.list = [
                        { id: 1, title: '公司新闻1', time: '2021-04-18' },
                        { id: 2, title: '公司新闻2', time: '2021-04-18' },
                    ];
                }
            },
            immediate: true,
        },
    },
    components: {
        aboutleft: aboutLeft,
        aboutright: aboutRight,
    },
};
</script>
<style scoped lang="scss">
#aboutus {
    display: flex;
    .left {
        width: 30%;
        background: #f0f0f0;
    }
    .right {
        width: 70%;
    }
}
</style>
